package com.jt.www.enums.endorse;

/**
 * 学制
 */

public enum EduSystemEnum {
    ONE(1, "edu_16", "一年制"),
    TWO(2, "edu_17", "二年制"),
    THREE(3, "edu_18", "三年制"),
    FOUR(4, "edu_19", "四年制"),
    FIVE(5, "edu_20", "五年制"),
    SIX(6, "edu_21", "六年制"),
    SEVEN(7, "edu_22", "七年制"),
    NINE(9, "edu_23", "九年制"),
    MIX(Integer.MAX_VALUE, "edu_24", "混合学制");

    /**
     * 教育编码
     */
    private int code;
    /**
     * 大平台编码
     */
    private String msg;
    /**
     * 描述
     */
    private String desc;

    EduSystemEnum(int code, String msg, String desc) {
        this.code = code;
        this.msg = msg;
        this.desc = desc;
    }

    public static int getCodeByMsg(String msg) {
        for (EduSystemEnum systemEnum : EduSystemEnum.values()) {
            if (systemEnum.msg.equals(msg)) {
                return systemEnum.code;
            }
        }
        return 0;
    }

    public static String getDescByMsg(String msg) {
        for (EduSystemEnum systemEnum : EduSystemEnum.values()) {
            if (systemEnum.msg.equals(msg)) {
                return systemEnum.desc;
            }
        }
        return "";
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
